package com.gk.controller;

import com.gk.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

//@RestController
@Controller
public class UserController {

    //    public String getUserId(HttpServletRequest request) {
//        String userId = request.getParameter("userId");
//        System.out.println("userId = " + userId);
//        return "register";
//    }
//    @ResponseBody
//    public void getUserId(@RequestBody User user) throws IOException {
////        String userId = request.getParameter("userId");
////        String password = request.getParameter("password");
////        System.out.println("userId = " + userId);
////        System.out.println("password = " + password);
////        response.getWriter().println("hhhh");
//        System.out.println(user);
//    }
    @RequestMapping("/registerUser")
    public void registerUser(User user) {
        String username = user.getUsername();
        String password = user.getPassword();
        System.out.println("username = " + username);
        System.out.println("password = " + password);
    }
}
